// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * TagRelation generated by hbm2java
 */
@Entity
@Table(name = "tag_relation", catalog = "magento", uniqueConstraints = @UniqueConstraint(columnNames = {
		"tag_id", "customer_id", "product_id", "store_id" }))
public class TagRelation implements java.io.Serializable {

	private Integer tagRelationId;
	private Tag tag;
	private CustomerEntity customerEntity;
	private CoreStore coreStore;
	private CatalogProductEntity catalogProductEntity;
	private short active;
	private Date createdAt;

	public TagRelation() {
	}

	public TagRelation(Tag tag, CoreStore coreStore,
			CatalogProductEntity catalogProductEntity, short active) {
		this.tag = tag;
		this.coreStore = coreStore;
		this.catalogProductEntity = catalogProductEntity;
		this.active = active;
	}

	public TagRelation(Tag tag, CustomerEntity customerEntity,
			CoreStore coreStore, CatalogProductEntity catalogProductEntity,
			short active, Date createdAt) {
		this.tag = tag;
		this.customerEntity = customerEntity;
		this.coreStore = coreStore;
		this.catalogProductEntity = catalogProductEntity;
		this.active = active;
		this.createdAt = createdAt;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "tag_relation_id", unique = true, nullable = false)
	public Integer getTagRelationId() {
		return this.tagRelationId;
	}

	public void setTagRelationId(Integer tagRelationId) {
		this.tagRelationId = tagRelationId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tag_id", nullable = false)
	public Tag getTag() {
		return this.tag;
	}

	public void setTag(Tag tag) {
		this.tag = tag;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_id")
	public CustomerEntity getCustomerEntity() {
		return this.customerEntity;
	}

	public void setCustomerEntity(CustomerEntity customerEntity) {
		this.customerEntity = customerEntity;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "store_id", nullable = false)
	public CoreStore getCoreStore() {
		return this.coreStore;
	}

	public void setCoreStore(CoreStore coreStore) {
		this.coreStore = coreStore;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "product_id", nullable = false)
	public CatalogProductEntity getCatalogProductEntity() {
		return this.catalogProductEntity;
	}

	public void setCatalogProductEntity(
			CatalogProductEntity catalogProductEntity) {
		this.catalogProductEntity = catalogProductEntity;
	}

	@Column(name = "active", nullable = false)
	public short getActive() {
		return this.active;
	}

	public void setActive(short active) {
		this.active = active;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_at", length = 19)
	public Date getCreatedAt() {
		return this.createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

}
